//package com.terabits.smartriver.auth.endpoint;//package com.terabits.watersupervision.auth.endpoint;
//
//import com.terabits.smartriver.constants.result.BaseResp;
//import com.terabits.smartriver.constants.result.ResultStatus;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.security.oauth2.provider.endpoint.FrameworkEndpoint;
//import org.springframework.security.oauth2.provider.token.ConsumerTokenServices;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RequestMethod;
//import org.springframework.web.bind.annotation.RestController;
//
//@FrameworkEndpoint
//@RestController
//public class RevokeTokenEndpoint {
//
//    @Autowired
//    private ConsumerTokenServices consumerTokenServices;
//
//    @RequestMapping(value = "/oauth/token", method = RequestMethod.DELETE)
//    public BaseResp revokeToken(String access_token) {
//        BaseResp result = new BaseResp();
//
//        if (consumerTokenServices.revokeToken(access_token)) {
//            result.setStatus(ResultStatus.SUCCESS.getErrorStatus());
//            result.setMessage("注销成功");
//        } else {
//            result.setStatus(ResultStatus.FAIL.getErrorStatus());
//            result.setMessage("注销成功");
//        }
//
//        return result;
//    }
//}
